package com.tl.mqs.mqs;

import com.huawei.it.eip.ump.client.consumer.ConsumeStatus;
import com.huawei.it.eip.ump.client.listener.MessageListener;
import com.huawei.it.eip.ump.common.message.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.UnsupportedEncodingException;

public class MessageCallback implements MessageListener {

    private Logger logger = LoggerFactory.getLogger(MessageCallback.class);

    @Override
    public ConsumeStatus consume(Message message) throws UnsupportedEncodingException {
        logger.info("接收的消息：{}",new String(message.getBody(),"UTF-8"));
        return ConsumeStatus.CONSUME_SUCCESS;
    }

}
